Online IVR Tutorial
Getting Started


The Xtend IVR Scripting language is simple to learn, flexible to implement and easy to code. The inherent technical complexity of creating an IVRS has been completely eliminated by the introduction of simple high level Telephony commands. Programmers can develop and deploy powerful IVR Solutions in less than a day. This Rapid Application Development capability of Xtend IVR combined with the flexibility of the Scripting language enables fast deployment of IVR solutions.

Program Flow and Structure

The Xtend IVR script revolves around these basic steps:

Data types

All variables in the Xtend IVR scripting language are internally stored as strings. However, when a numeric operation (like addition or subtraction) is performed on a variable the contents of the variable would be taken as a signed integer and the numeric operation is performed.

Variables

All variable names starting with a $ symbol, are not case sensitive and can be of any length. Alphabets, numbers and underscores can be used in a variable name. However, a variable cannot start with a number or underscore. Since variable is not typed, pre-declaration of the variable is not required. A variable can be directly used and would contain an initial value of "".

These are some valid Xtend IVR variable names:

These are some invalid Xtend IVR variable names:


Operators & Expressions in Xtend IVR

Xtend IVR supports the following operators

Arithmetic Operators:

Relational Operators:

Relational operators return a boolean value, TRUE or FALSE.

= Equality (same symbol as assignment (above))
== Equality
!= Inequality
<> Inequality
< Lesser than
> Greater than
<= Lesser than or equal to
>= Greater than or equal to
Bitwise Operators:
& AND
| OR
^ XOR
<< Shift bits to left
>> Shift bits to the right
Macro Operator:

"$" can be used as a macro operator to access a variable value inside variable. This can be used to iterate through multiple variables, for example, assume $abc = 5 and $def = "$abc". Then the value of $$def is 5.

Expressions

Expressions are statements containing variables, constants, functions and operators. Xtend IVR allows all standard expressions to be implemented directly in the script. Some of the valid expressions are:

Eg:
$Val = 3
$Result = $Num1 + $Num2
$Per = ($curr/$Max) * 100
$Inc += 1


Labels

Labels are named locations in the script. You can use the Goto command to redirect script execution to a specified label. In Xtend IVR labels must start or end with a colon.

Examples of valid labels are:

:REPEAT_MENU
:TRY3
MAIN:
:GET_ACCOUNT_NUMBER
BEGIN:

Some invalid labels are:

:_thisisaninvalidlabel
:59_Times
:$TryAgain
:$Not_In_Queue*


Event Labels

The labels given below will be executed when specific events (like line disconnect) happen.

:ONSYSTEMERROR

This label is executed when a critical system error occurs. Usually this means that Xtend IVR is unable to continue execution of the script. Examples where this can happen include attempting to play a file that is not present in the system, internal engine errors, attempting to use Speech Recognition or text-to-speech when SAPI is not installed etc.

:ONHANGUP

This label is executed when the remote party disconnects the phone line. This label is not called when the script executes hangup. Useful to determine if the remote party hung-up the call.

:ONTIMEOUT

This label is executed when the Timeout command is in use and the script has exceeded the time allocated for it while in a call. This is quite useful to specify that a user should not exceed an allocated time. The Timeout command can be used as and when needed to increase or decrease the specified time.

:ONRUNTIMEOUT

Legacy plugins executed via the Run command have a RunTimeout command to specify how long the script should wait for the program to exit. If legacy plugins are not being used. This section is not required.



See Also Commands, Functions